/**
 * 
 */
package com.zhiteng.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.zhiteng.entity.Manager;
import com.zhiteng.mapper.ManagerMapper;
import com.zhiteng.service.ManagerService;

/**  
* <p>Title: UserServiceImpl.java</p>  
* <p>Description: 管理员Service</p>  
* @author dragon  
* @date 2018年11月9日  
* @version 1.0  
*/
@Service
public class ManagerServiceImpl implements ManagerService {
	@Autowired
	private ManagerMapper managerMapper;

	@Override
	public Manager queryManager(Manager manager) {
		return managerMapper.selectOne(manager);
	}

	@Override
	public void saveManager(Manager manager) {
		managerMapper.insertSelective(manager);
	}

	@Override
	public List<Manager> queryAllManagerBySchoolId(String schoolId) {
		Manager manager = new Manager();
		manager.setSchoolId(schoolId);
		return managerMapper.select(manager);
	}

	@Override
	public int deleteManagerBatch(String[] ids) {
		int count = 0;
		for (String id : ids) {
			managerMapper.deleteByPrimaryKey(id);
			count++;
		}
		return count;
	}

}
